import { Router } from 'express'
import UsersController from './Users'
import FileController from './File'
import ConfigController from './Config'
import CommonController from './Common'

import AboutusController from './Aboutus'
import AddressController from './Address'
import CartController from './Cart'
import ChanpinfenleiController from './Chanpinfenlei'
import CouponController from './Coupon'
import DiscussshuiguoshangpinController from './Discussshuiguoshangpin'
import MessagesController from './Messages'
import MycouponController from './Mycoupon'
import NewsController from './News'
import NewstypeController from './Newstype'
import OrdersController from './Orders'
import ShangjiaController from './Shangjia'
import ShuiguoshangpinController from './Shuiguoshangpin'
import StoreupController from './Storeup'
import SystemintroController from './Systemintro'
import YonghuController from './Yonghu'

export default ({ config, db }) => {
	let api = Router()
	api.use('/users', UsersController({ config, db }))
	api.use('/file', FileController({ config, db }))
	api.use('/config', ConfigController({ config, db }))
	api.use('/', CommonController({ config, db }))

api.use('/aboutus', AboutusController({ config, db }))
api.use('/address', AddressController({ config, db }))
api.use('/cart', CartController({ config, db }))
api.use('/chanpinfenlei', ChanpinfenleiController({ config, db }))
api.use('/coupon', CouponController({ config, db }))
api.use('/discussshuiguoshangpin', DiscussshuiguoshangpinController({ config, db }))
api.use('/messages', MessagesController({ config, db }))
api.use('/mycoupon', MycouponController({ config, db }))
api.use('/news', NewsController({ config, db }))
api.use('/newstype', NewstypeController({ config, db }))
api.use('/orders', OrdersController({ config, db }))
api.use('/shangjia', ShangjiaController({ config, db }))
api.use('/shuiguoshangpin', ShuiguoshangpinController({ config, db }))
api.use('/storeup', StoreupController({ config, db }))
api.use('/systemintro', SystemintroController({ config, db }))
api.use('/yonghu', YonghuController({ config, db }))

return api
}